package com.qing.design.patterns.visitor.example;

import com.qing.design.patterns.visitor.example.user.User;
import com.qing.design.patterns.visitor.example.user.impl.Student;
import com.qing.design.patterns.visitor.example.user.impl.Teacher;
import com.qing.design.patterns.visitor.example.visitor.Visitor;

import java.util.ArrayList;
import java.util.List;

/**
 * 数据看板
 */
public class DataView {

    List<User> userList=new ArrayList<>();

    public DataView() {
        userList.add(new Student("AAA","重点班级","一年级一班"));
        userList.add(new Student("BBB","重点班级","一年级一班"));
        userList.add(new Student("DDD","普通班级","二年级二班"));
        userList.add(new Student("CCC","普通班级","二年级二班"));
        userList.add(new Student("EEE","重点班级","一年级一班"));

        userList.add(new Teacher("孔老头","特级","一年级一班"));
        userList.add(new Teacher("周老师","普通","二年级二班"));
        userList.add(new Teacher("小唐老师","实习","一年级一班"));
        userList.add(new Teacher("米老师","特级","三年级一班"));
    }


    public void show(Visitor visitor){
        for (User user : userList) {
            user.accept(visitor);
        }
    }
}
